<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
  <title>Document</title>
</head>
<body>
  <button id="bt">请求</button>

  <script>
    $('#bt').on('click', function () {
      $.ajax({
        type: 'POST',
        url: '/login',
        dataType: 'JSON',
        data: {
          firstName: 'lee',
          lastName: 'can'
        },
        success: function (data) {
          console.log(data)
        },
        error: function (err) {
          console.log(err)
        }
      })
    })
  </script>
</body>
</html>